;(function (w,undefined) {
  $.fn.extend({
      lazyload() {
          this.show()
          let t=null
          $(window).scroll(() => {
              if (t) return   
              t = setTimeout(() => {
                  this.show()
                  t = null
              }, 1000)
          })
      },
      show() {
          let height1= document.documentElement.scrollTop || document.body.scrollTop
          let height2= window.innerHeight || document.documentElement.clientHeight
          let totalHeight = height1 + height2
          this.each((i, item) => {
          let imgTop=$(item).offset().top
              if (imgTop <= totalHeight) {
                  $(item).attr('src', $(item).attr('data-original'))
              }
          })
      }
  })
})(window)